From 9b3f84e763810ab101bfc2bdcee7a319eb73218c Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 12 Sep 2014 12:37:35 -0700 Subject: [PATCH] SearchResult: clean up construction - Remove old pre-1.17 constructor format. No core or extension callers - Remove only usage of newFromRow(), needless abstraction Change-Id: Ifad161aa36837bb4c8b5c9aecac1c46e2e6cc84c --- includes/search/SearchResult.php | 29 ----------------------------- includes/search/SearchResultSet.php | 4 +++- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/includes/search/SearchResult.php b/includes/search/SearchResult.php index c6d5d4ffc1..aeaba8df32 100644 --- a/includes/search/SearchResult.php +++ b/includes/search/SearchResult.php @@ -61,35 +61,6 @@ class SearchResult { return $result; } - /** - * Return a new SearchResult and initializes it with a row. - * - * @param object $row - * @return SearchResult - */ - public static function newFromRow( $row ) { - $result = new self(); - $result->initFromRow( $row ); - return $result; - } - - public function __construct( $row = null ) { - if ( !is_null( $row ) ) { - // Backwards compatibility with pre-1.17 callers - $this->initFromRow( $row ); - } - } - - /** - * Initialize from a database row. Makes a Title and passes that to - * initFromTitle. - * - * @param object $row - */ - protected function initFromRow( $row ) { - $this->initFromTitle( Title::makeTitle( $row->page_namespace, $row->page_title ) ); - } - /** * Initialize from a Title and if possible initializes a corresponding * Revision and File. diff --git a/includes/search/SearchResultSet.php b/includes/search/SearchResultSet.php index 698f93c287..406d322d6f 100644 --- a/includes/search/SearchResultSet.php +++ b/includes/search/SearchResultSet.php @@ -161,7 +161,9 @@ class SqlSearchResultSet extends SearchResultSet { return false; } - return SearchResult::newFromRow( $row ); + return SearchResult::newFromTitle( + Title::makeTitle( $row->page_namespace, $row->page_title ) + ); } function free() { -- 2.20.1